#ifndef IAUDIO_H
#define IAUDIO_H

#include <string>
using namespace std;

//!Interface class for the audio component.
class IAudio
{
public:

	//!Destructor.
	virtual ~IAudio(){};

	//!Initialise the audio component.
	virtual bool init(void)=0;

	//!Load a sound .wav.
	/*!
	\param idSound Index of the sound.
	\param path Path of the sound file.
	\return True if the sound was loaded. False if it failed.
	*/
	virtual bool loadSound(int* idSound, string path)=0;

	//!Load a wav sound from a zpak file.
	/*!
	\param idSound Index of the sound file.
	\param filename Name of the file.
	\return True if the file was found and loaded. False if the file wasn't found in the zpak file or if the buffer 
	was corrupted.
	*/
	virtual bool loadSoundFromMemory(int* idSound, const string& filename)=0;

	//!Player a sound.
	/*!
	\param indexSound index of the sound to play.
	\return -1 if failed or 0 in other case.
	*/
	virtual int playSound(int indexSound)=0;

	//Stop all the sounds.
	virtual void clearPlayingSounds(void)=0;

	//!Set the volume
	/*!
	\param volume New volume.
	*/
	virtual void setVolume(int volume)=0;

	//!Get the volume.
	/*!
	\return Return the volume of the sound.
	*/
	virtual int getVolume(void)const=0;
};

#endif

